<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
import Reject from "./../reject/index";
export default {
  mixins: [Vue.prototype.$vFN.Mixins.Base, Vue.prototype.$vFN.Mixins.Edit],
  components: {},
  data() {
    return {
      appWindow: window,
      form: {},
    };
  },
  methods: {
    // 初始化
    async init() {
      // 初始化数据
      // await this.mixinEdit_editBoxInit({
      //     model: "form",
      //     id: this.id,
      // })
      // 显示窗口
      this.mixinEdit_editVisible = true;
        console.log(this.id);
      this.form = this.data;
    },
    // 驳回审核
    async reject() {
      Reject.init({
        mixinEdit_parent: this,
        id: this.data.id,
        data: this.data,
        onSuccess: (res) => {
          this.onSuccess();
          this.mixinEdit_editVisible = false;
        },
      });
    },
    async pass() {
      let res = await this.$vFN.Http.post(
        {
          url: "admin/goods/pass",
          data: {
            ids: this.id,
          },
        },
        window
      );
      if (res.success) {
        this.mixinEdit_editVisible = false;
        this.onSuccess();
        this.$vFN.Tools.messageSuccess("操作成功");
      }
    },
    // 成功回调
    onSuccess() {},
  },
  mounted() {
    this.init();
  },
  activated() {},
};
</script>